<%@ page language="java" import="java.util.*,model.Student,util.DateTool" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>学年管理</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <link rel="stylesheet" type="text/css" href="css/div-style.css">
    <link rel="stylesheet" type="text/css" href="css/table.css">
  </head>
  
  <body>
    <div class="main">
    <div class="div_top">
        <div id="info">
            <p id="p1">欢迎您，${username}</p><a class="ainfo" href="">修改密码</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="ainfo" href="/wdcoursemgn/logout">注销</a>
        </div>
    </div>
    <div  class="teacher_left">
          <!-- 左边菜单栏 -->
         <div id="menu">
              <!-- 修饰，无实际作用 -->
         </div>
         <div class="list">
                 <ul class="list1">
                  <li> <a class="a-select" href="/wdcoursemgn/yearmgn"><font>学年管理</font></a></li>
                  <li> <a class="a-list" href="/wdcoursemgn/release"><font>作业发布</font></a></li>
                  <li> <a class="a-list" href="/wdcoursemgn/checksubmit"><font>作业查看</font></a></li>
                  <li> <a class="a-list" href="/wdcoursemgn/grade"><font>作业打分</font></a></li>
                  <li> <a class="a-list" href=""><font>作业展示</font></a></li>
                </ul>
         </div>
    </div>
    <div  class="div_right">
           <div class="year_import">
               <form action="importstuexcel" enctype="multipart/form-data" method="post">
                                                                                 选择学年：<select name="year">
                                      <option>2016/2017</option>
                                      <option>2017/2018</option>
                                      <option>2018/2019</option>
                                      <option>2019/2020</option>
                                      <option>2020/2021</option>
                                      <option>2021/2022</option>
                                      <option>2022/2023</option>
                                      <option>2023/2024</option>
                                      <option>2024/2025</option>
                               </select>
                        &nbsp;   
                                                           选择学生表格：<input type="file" name="file">
                      <input type="submit" value="导入">
                </form>
                ${importmessage}
           </div>
           <div class="year_import">
               <%
                    ArrayList<Student> StudentList=new ArrayList<Student>();
                    if(request.getAttribute("StudentList")!=null)
                     StudentList= (ArrayList<Student>)request.getAttribute("StudentList");
                %>
                <p id="p4" style="margin-left:50px">当前学年:&nbsp; ${schoolyear}</p>
                <p id="p4" style="margin-left:50px">导入学生信息如下</p>
                <table id="table-1" style="margin:0 auto">
                  <tr>
                       <th>学号</th>
                       <th>姓名</th>
                       <th>学年</th>
                  </tr>
                  <%
                      for(int i=0;i<StudentList.size();i++) {
                         Student student=StudentList.get(i);
                         String Stu_id=student.getStu_id();
                         String name=student.getName();
                         String schoolyear=student.getYear();
                  %>
                  <tr>
                      <td><%=Stu_id%></td>
                      <td><%=name%></td>
                      <td><%=schoolyear%></td>
                      
                  </tr>
                   <% 
                       }
                   %>
                </table>
            </div>
    </div>
    
    </div>
  </body>
</html>
